package chapter05

/**
 * Created with IntelliJ IDEA.
 * ClassName: Test13_Lazy
 * Package: chapter05
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 *          Date: 2023-06-20
 *          Time: 17:27
 */

object Test13_Lazy {
  def main(args: Array[String]): Unit = {
    //懒加载的过程
    lazy val result :Int = sun(13,47)

    println("1.函数调用")
    println("2.result = " + result)
  }

  def sun(a:Int,b:Int):Int = {
    println("3.sum调用")
    a + b
  }

  //1.函数调用
  //3.sum调用
  //2.result = 60

}
